<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/Validform_v5.3.2_ncr_min.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<script type="text/javascript">
function get_pandian(url,close_time){
	var dialog = art.dialog({title: '提示',icon:'question',lock: true});
	dialog.content('<p>提交中，请稍后1111...<p>');
	$.get(
    	    url,
    	     {
    	    	close_time:close_time,
	    	 },
	    	 function(data){
		    	 if(data){
		    		 dialog.content('<p>关账成功<p>');
		    		 window.location.reload();
		    	 }
	   	     }
    	 );     
}
$(function(){
	$.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
	$("#start").datepicker({
	});
	$('.btn').click(function(){
            var id=$(this).attr('id');
            var close_date;
            if(id=='save'){
            	close_date=$('#start').val();
            }else{
            	close_date='2014-01-01';
            }
            url='<?php echo URL::base() ?>inventory/account/close_bill';
    		get_pandian(url,close_date);   
		});
});
</script>
<div class="row">
  <div class="span11">
  <form class="form-horizontal"  >
    	      	<div class="control-group">
    	      		<label style="width:80px;margin-right: 4px;" class="control-label w-label">关账时间:</label>
					<div class="controls" style="margin-left:70px;">
						<input type="text" style=" width:164px;"  name='close_date' id='start' class="datepicker" value="<?php echo $time?$time:date('Y-m-d'); ?>">
						<div style="margin-left:5px;" class="btn btn-info" id="save">确定</div>
					</div>
					</div>
          </form>
        </div>
  <div class="span4">
  </div>
</div>

   
